/* eslint-disable import/prefer-default-export */
import request from '@/utils/request';
/**
 * 公司目录树
 * @param {*} params
 */
export async function getCompanyTree(params) {
    // return request('/api/org/v1/functional/list', {
    return request('/api/uc/org/v1/orgLinkList', {
        method: 'POST',
        data: params
    });
}
/**
 * 部门目录树
 * @param {*} params
 */
export async function getDepartmentTree(params) {
    return request('/api/org/v1/functional/list', {
        method: 'POST',
        data: params
    });
}
/**
 * 部门目录树
 * @param {*} params
 */
export async function getWorkFlowDepartmentTree(params) {
    return request('/api/oa/workflow/approveorg/v1/getdepartmenttree', {
        params
    });
}

/**
 * 根据公司id 获取职位列表
 * @param {string} companyId
 */
export async function getPostlist() {
    return request('/api/uc/position/v1/list', {
        method: 'POST'
    });
}

/**
 * 获取岗位列表
 */
export async function getDutylist() {
    return request('/api/uc/approve/v1/duty/list', {
        method: 'GET'
    });
}

/**
 * 获取岗位列表不受权限控制
 */
export function fetchDutyList() {
    return request('/api/uc/duty/v1/getList', {
        method: 'POST'
    });
}

/**
 * 根据公司id 获取角色列表
 * @param {string} companyId
 */
export async function getRoleList(params) {
    return request(`/api/oa/v1/role/getallrole/${params.companyId}`, {
        method: 'GET'
    });
}
/**
 * 基础数据字典
 */
export async function getTypeList({ dictCode }) {
    return request('/api/oa/v1/common/select/typelist', {
        method: 'POST',
        params: { dictCode }
    });
}
/**
 * 全部应聘职位下拉
 */
// export async function getApplyjob(params) {
//     return request(`/api/oa/v1/recruit/querylist/${params.useCompanyId}`, {
//         method: 'GET'
//     });
// }

export async function getApplyjob(params) {
    return request('/api/oa/v1/recruit/querylistbypost', {
        method: 'POST',
        data: params
    });
}

export async function getpostlistbycondition(params) {
    return request('/api/oa/v1/post/getpostlistbycondition', {
        method: 'POST',
        data: params
    });
}

/**
 * 候选管理人下拉
 */
export async function getEmployeeInfoList(params) {
    // return request('/api/oa/v1/employee/getemployeelist', {
    return request('/api/uc/org/employee/v1/employee/simple/info/list', {
        method: 'POST',
        data: params
    });
}

/**
 * 调岗发起申请-候选管理人下拉
 */
export async function getApplyEmployeeInfoList(params) {
    return request('/api/org/v1/employeeInfo/queryEmployeeInfoList2', {
        // return request('/api/org/v1/employeeInfo/queryEmployeeInfoList2', {
        method: 'POST',
        data: params
    });
}

/**
 * 基础字典
 */
export async function getDict(params) {
    return request('/api/dict/v1/getList', {
        method: 'POST',
        data: params
    });
}
